package com.xbongbong.pro.dynamic.pojo.dto;

import com.xbongbong.paas.pojo.dto.SaasFormSaveDTO;
import com.xbongbong.pro.opportunity.pojo.JudgeStageChangedPojo;
import com.xbongbong.sys.domain.entity.UserEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 *动态
 *
 *@author weijianxun
 */
@Setter
@Getter
@ToString
public class DynamicSaveDTO implements Serializable {
    private static final long serialVersionUID = -6746410175810812520L;

    @NotNull
    private Long dataId;
    @NotNull
    private Long formId;
    @NotNull
    private SaasFormSaveDTO saasFormSaveDTO;

    /**
     * 创建者用户信息
     */
    @NotNull
    private UserEntity creator;

    /**
     * 阶段变化信息
     */
    private JudgeStageChangedPojo judgeStageChangedPojo;

    public static DynamicSaveDTO initDynamicSaveDTO(@NotNull Long dataId, Long formId, SaasFormSaveDTO saasFormSaveDTO, UserEntity creator,
                                                    JudgeStageChangedPojo judgeStageChangedPojo) {
        DynamicSaveDTO dynamicSaveDTO = new DynamicSaveDTO();
        dynamicSaveDTO.setDataId(dataId);
        dynamicSaveDTO.setFormId(formId);
        dynamicSaveDTO.setSaasFormSaveDTO(saasFormSaveDTO);
        dynamicSaveDTO.setCreator(creator);
        dynamicSaveDTO.setJudgeStageChangedPojo(judgeStageChangedPojo);
        return dynamicSaveDTO;
    }
}
